package com.me.hippy.sdk

import android.os.Bundle
import android.view.Gravity
import android.widget.FrameLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.hippy.lib.utils.view.*

class ViewUtilsTestAty : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val rootLinearLayout = ViewUtils.createLinearLayout(this)
        rootLinearLayout.setBackgroundColor(0xff00ff00.toInt())
        rootLinearLayout.hiLayoutParams(-1, -2)

        val titleFrameLayout = FrameLayout(this)
        rootLinearLayout.hiAddView(titleFrameLayout, -1, -2)
//
        val titleTv = TextView(this)
        titleFrameLayout.hiAddView(titleTv, -2, -2)
        titleTv.hiSetTextSize(16f)
        titleTv.setTextColor(0xffffffff.toInt())
        titleTv.hiLayoutGravity(Gravity.CENTER_HORIZONTAL)
        titleTv.hiMargin(20f)
        titleTv.text = "我是标题"

        setContentView(rootLinearLayout)
    }
}